Lab 3.1 Weight 

PURPOSE:

	In this lab the program code is given for in the SOLUTION section below for a weight program that determines weight of an object when the mass is inputted.  However, errors have been introduced into the program.  Your objective is to find the errors in the programs and correct them so that the program runs.  Use previous programs as your guide.  Afterwards, complete the lab report by completing all sections of the lab report and submitting it to drop box Lab 3.1.

ALGORITHM

1.	*BASIC INFORMATION (5 points)

•	State your name, class, section, instructor’s name, assignment number,
and date.

2.	*DATA STRUCTURES  (25 points)

•	Describe the important variable in your program.  
•	For each of these  variables give its type and a description of the variable’s usage in the the program.  
•	Do not describe less important variable such as subscripts
and loop control variables.

3.	*DATA MAIPULATION INSTRUCTIONS (25 points)
	       An algorithm requires instruction that allow the computer to do the following
•	Obtain data values and store them in data structures.
•	Manipulate those data values- that is, modify the value of a data structure via arithmetic operations, copy the contents of one data structures to another, etc.
•	Output the resulting data values.
•	Therefore, list the steps you will take to solve the problem of Lab 3.1.

3.	*CONDITIONAL EXPRESSIONS 

			NA

4.	*CONTROL STRUCTURES  

			NA

5.	*MODULES
6.	SOLUTION (20 points)

•	//**********************************************************
•	
•	// Determines the weight of an object in Newtons
•	//**********************************************************
•	import java.util.Scanner;
•		public class Weight_X
•			publc static void main(String[] args){
•			final double g = 9.81;
•			doubl mass, weight ;
•	/***************************************************************************/	
•			Scanner scan = new Scanner(System.in)
•			System.out.print (Enter the mass of the object in kilograms ");
•			mass = scan.nextInt();
•			weight = g * mass;
•			System.out.println("The weight of the object is " + weight+ "Newtons");
•	/****************************************************************************/
•		}
•	}

7.	POSSIBLE IMPROVEMENTS (10 points)

•	Describe how you could improve the program if you had more time.  
•	What improvements would make the program faster, more general, simpler,  or easier to understand?

8.	SUMMARY (15 points)

•	What is the algorithm for this lab?  
•	Do you understand the algorithm?
•	What questions do you have about the algorithm?
•	What errors did you find in this lab?
•	What is the name of the errors that were introduced into the program
•	Submit Lab 3.1 to the drop box.

9	APPENDIX
	
•	An algorithm is a set of steps that when applied to a problem solves the problem
•	Informally, an algorithm is any well-defined computational procedure that
takes some value, or set of values, and input and produces some value, or
set of values, as output.
•	An algorithm is thus a sequence of computational steps that transform the 
input into the output.
•	Well-designed algorithms have three key properties:  (1) precision,
(2) simplicity, (3) Levels of Abstraction
•	Algorithms need to be precise.
•	Each step of an algorithm must also be simple.
•	Algorithms should have levels of abstractions, ideas apart from the objects in your program (e. g. classes & methods).

*Theses items should be completed by the student and sent to the teacher in a word document by e-mail to before you begin solving the problem.